package com.example.leetcode.math.common.strategy;

import java.util.ArrayList;
import java.util.List;

public class CustomFunctionContext {

    List<CustomFunction> strategies = new ArrayList<>();

    public CustomFunctionContext() {
        strategies.add(new AddFunction());
        strategies.add(new MultiplyFunction());
    }

    public CustomFunction isOK(int function_id) {
        for (CustomFunction customFunction : strategies) {
            if (customFunction.getFunctionId() == function_id) {
                return customFunction;
            }
        }
        return null;
    }
}
